package com.check.dao.impl;

import java.util.List;
import java.util.Map;

import org.springframework.stereotype.Repository;

import com.check.dao.PcwhDao;
import com.check.pojo.Pcwh;

@Repository("pcwhDao")
public class PcwhDaoImpl extends BaseSqlMapDao implements PcwhDao{

	public List<Pcwh> findAllPcwh(Map<Object, Object> map) {
		return getSqlMapClientTemplate().queryForList("Pcwh.findAllPcwh",map);
	}

	public int findPcwhCount() {
		return ((Integer) getSqlMapClientTemplate().queryForObject("Pcwh.findPcwhCount")).intValue();
	}

	public void insertPcwh(Pcwh pcwh) {
		insertObject("Pcwh.insertPcwh", pcwh);
	}

	public Pcwh findByCheckYear(String checkYear) {
		return (Pcwh) getSqlMapClientTemplate().queryForObject("Pcwh.findByCheckYear",checkYear);
	}

	public void updatePcwh(Pcwh pcwh) {
		updateObject("Pcwh.updatePcwh", pcwh);
	}

	public void deletePcwh(String  checkYear) {
		updateObject("Pcwh.deletePcwh", checkYear);
	}

	public void activePcwh(String checkYear) {
		updateObject("Pcwh.activePcwh", checkYear);
	}

	public void unactivePcwh(String checkYear) {
		updateObject("Pcwh.unactivePcwh", checkYear);
	}

	public void unactivePcwhElse(String checkYear) {
		updateObject("Pcwh.unactivePcwhElse", checkYear);
	}

	public Pcwh findActivePcwh(){
		return (Pcwh) getSqlMapClientTemplate().queryForObject("Pcwh.findActivePcwh");
	}
	
	
}
